<template>
  <div class="header">
    <div class="my">
      <img src="../../assets/icon/向左返回.svg" @click="goback"/>
      <p>中意租客</p>
    </div>
    <van-tabs v-model="activeName">
      <van-tab title="收藏租客" name="a">
        <div class="good-tenant" >
       <div v-for="item in iscollet" :key="item.id">
      
          <section class="tenant-message">
            <img :src="item.portrait" alt="" />
            <div class="tt-message">
                

              <div class="sir">
                <strong>{{ item.name }}</strong>
                |
                <span class="bg1">{{ item.methods }}</span>
                <span class="bg2">{{ item.age }}岁</span>
   

              </div>
              <p>预计租期:{{ item.term }}</p>
              <p>期望入住时间: {{ item.date }}</p>
            
              <!-- 收藏心心 -->
              <!-- <img
                :src="item.bol ? src2 : src1"
                alt=""
                class="image"
                @click="getIndex(index)"
              /> -->
            </div>
          </section>

          <div class="choie">
            <ul>
              <li>
                <p>意向区域</p>
                <span>{{ item.city }}</span>
              </li>
              <li>
                <p>租金范围</p>
                <span>{{ item.rent }}/月</span>
              </li>
            </ul>
          </div>
      </div>
        </div>
      </van-tab>
      <van-tab title="联系租客" name="b">联系租客</van-tab>
      <van-tab title="推送租客" name="c">推送租客</van-tab>
    </van-tabs>
  </div>
</template>
<script>
//vant插件
import Vue from "vue";
import { Tab, Tabs } from "vant";
Vue.use(Tab);
Vue.use(Tabs);
import { mapState } from "vuex";
export default {
  data() {
    return {
      activeName: "a",
    };
  },
  methods:{
  goback(){
            this.$router.go(-1)
        }
  },
  computed: {
    ...mapState(["iscollet"]),
  },
  mounted() {
    console.log(this.iscollet);
  },
};
</script>
<style lang="scss" scoped>
.header {
  font-size: 16px;
  .my {
    line-height: 30px;
    height: 30px;
    display: flex;
    border-bottom: 1px solid rgb(243, 241, 241);
    img {
      width: 20px;
      margin-left: 5px;
    }
    p {
      margin: 0 auto;
    }
  }
  .good-tenant {
    width: 90%;
    font-size: 14px;
    margin: 0 auto;

    .tenant-message {
      display: flex;
      margin-top: 15px;
      position: relative;
      img {
        width: 45px;
        height: 45px;
        border-radius: 50%;
      }
      .image {
        position: absolute;
        right: 0;
        top: 20px;
        width: 20px;
        height: 20px;
      }
      .tt-message {
        margin-left: 10px;

        p {
          // padding: .5px;
          margin: 5px;
          color: gray;
        }
        .sir {
          display: flex;
          strong {
            margin-right: 8px;
          }
          .bg1 {
            display: block;
            width: 30px;
            text-align: center;
            background-color: #4783f7;
            color: rgb(243, 239, 239);
            margin-left: 8px;
            font-size: 12px;
          }
          .bg2 {
            padding: 1px;
            box-sizing: border-box;
            background-color: rgb(236, 230, 230);
            margin-left: 5px;
            font-size: 12px;
          }
        }
      }
    }
    .choie {
      margin-top: 10px;
      ul {
        display: flex;
        justify-content: space-between;
        li:nth-child(1) {
          border-right: 1px solid rgb(240, 233, 233);
          padding-right: 5px;
        }
        li {
          width: 50%;
          text-align: center;
          border-bottom: 1px solid rgb(236, 229, 229);
          padding-bottom: 10px;

          p {
            margin: 0;
          }
          span {
            color: rgb(233, 109, 26);
          }
        }
      }
    }
  }
}
</style>